<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <div>
        <button onclick="testGet()">GET请求</button>
        <button onclick="testPost()">POST请求</button>
        <button onclick="testPut()">PUT请求</button>
        <button onclick="testDelete()">DELETE请求</button>
    </div>
    <script src="https://cdn.bootcdn.net/ajax/libs/axios/0.21.1/axios.js"></script>
    <script>
        const instance = axios.create({
            baseURL: 'http://localhost:3000'
        })
        // instance({
        //     url: '/posts'
        // })
        instance.get('/posts')
        const instance2 = axios.create({
            baseURL: 'http://localhost:4000'
        })
        instance.get('/xxx')


    </script>
</body>

</html>